﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace VTFC
{
    // ----------------------------------------------------------------------------
    /// <summary>
    /// Encapsulates all - culture independent - constant values
    /// </summary>
    // ----------------------------------------------------------------------------
    public class Constant
    {
        /// <summary>Document Workspace Web Service path.</summary>
        public const string TFS_DWS_URL         = @"/_vti_bin/Dws.asmx";
        /// <summary>List Data Retrieval Web Service path.</summary>
        public const string TFS_LISTS_URL       = @"/_vti_bin/Lists.asmx";
        /// <summary>List Data Retrieval Web Service path.</summary>
        public const string TFS_USERGROUP_URL   = @"/_vti_bin/UserGroup.asmx";

        /// <summary>Document library template id.</summary>
        public const int TFS_DOCUMENTLIBRARY_TEMPLATEID = 101;
        /// <summary>DWS web service response.</summary>
        public const string TFS_DWS_SUCCESS_RESPONSE    = "<Result/>";
        /// <summary>Success result.</summary>
        public const string TFS_LISTS_SUCCESS_RESPONSE  = "0x00000000";
                
        /// <summary>0: Server.Url; 1: file extension</summary>
        public const string TFS_FILEICON_URL    = "{0}/_layouts/images/ic{1}.gif";
        /// <summary>Unknown document icon on TFS server.</summary>
        public const string TFS_GENICON_URL     = "{0}/_layouts/images/icgen.gif";

        /// <summary>Lists.UpdateListItems web method updates argument for update new document.</summary>
        public const string TFS_UPDATEDOCUMENT_XML  = "<Method ID='1' Cmd='{0}'><Field Name='ID'>1</Field><Field Name='FileRef'>{1}</Field></Method>";
        /// <summary>Lists.UpdateListItems web method updates argument for rename a document.</summary>
        public const string TFS_RENAMELISTITEM_XML  = "<Method ID='1' Cmd='{0}'><Field Name='ID'>1</Field><Field Name='FileRef'>{1}</Field><Field Name='BaseName'>{2}</Field></Method>";
        /// <summary>Delete command in method XmlNode.</summary>
        public const string TFS_COMMAND_DELETE      = "Delete";
        /// <summary>Update command in method XmlNode.</summary>
        public const string TFS_COMMAND_UPDATE      = "Update";

        /// <summary>Content XML file name.</summary>
        public const string VTFC_CONTENT_FILE = "Content.tfc";
        /// <summary>Server XML file name.</summary>
        public const string VTFC_SERVERS_FILE = "Servers.xml";

        /// <summary>App configuration keys.</summary>
        public const string VTFC_CONFIGURATION_APPSETTINGS          = "appSettings";
        /// <summary>App configuration AutoConnect key.</summary>
        public const string VTFC_CONFIGURATION_AUTOCONNECT          = "AutoConnect";
        /// <summary>App configuration ConnectionTimeout key.</summary>
        public const string VTFC_CONFIGURATION_CONNECTIONTIMEOUT    = "ConnectionTimeout";
        
        /// <summary>Offset of imgListFile ImageList.</summary>
        public const int VTFC_IMGLISTFILE_OFFSET            = 2;

        /// <summary>Offset on axis x of txtRename control.</summary>
        public const int VTFC_DOCUMENTLIST_RENAME_OFFSET_X  = 5;
        /// <summary>Offset on axis y of txtRename control.</summary>
        public const int VTFC_DOCUMENTLIST_RENAME_OFFSET_Y  = 0;
        /// <summary>Width of lvDocuments control.</summary>
        public const int VTFC_DOCUMENTLIST_DEFAULT_WIDTH    = 581;
        /// <summary>Offset on axis x of colFileName control.</summary>
        public const int VTFC_DOCUMENTLIST_FILENAME_OFFSET  = 395;
        /// <summary>Offset on axis x of txtRename control.</summary>
        public const int VTFC_FOLDERTREE_RENAME_OFFSET_Y    = 0;

        /// <summary>Size display template in Mb.</summary>
        public const string VTFC_SIZE_DISPLAY_MB = "{0} Mb";
        /// <summary>Size display template in Kb.</summary>
        public const string VTFC_SIZE_DISPLAY_KB = "{0} Kb";

        /// <summary>Application small name.</summary>
        public const string VTFC_APPLICATION_SMALL_NAME  = "VTFC";
        /// <summary>Application full name.</summary>
        public const string VTFC_APPLICATION_FULL_NAME   = "Visual Team Foundation Client";

        /// <summary>Checked out item forecolor property.</summary>
        public static Color VTFC_CHECKED_ITEM_FORECOLOR = Color.Red;
        /// <summary>Normal, unchecked item forecolor property.</summary>
        public static Color VTFC_NORMAL_ITEM_FORECOLOR  = Color.Black;
        /// <summary>Skipped item back color property.</summary>
        public static Color VTFC_SKIPPED_ITEM_BACKCOLOR = Color.Yellow;
        /// <summary>Rename control backcolor property.</summary>
        public static Color VTFC_RENAME_CONTROL_BACKCOLOR = Color.White;
        /// <summary>Out of sc document forecolor property.</summary>
        public static Color VTFC_OUTER_ITEM_FORECOLOR = Color.Silver;

    }//class Constant
}//namespace VTFC
